# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=osv-scanner
pkgver=1.3.2
pkgrel=1
pkgdesc="Vulnerability scanner written in Go which uses the data provided by https://osv.dev"
url='https://github.com/google/osv-scanner'
arch=('loong64' 'x86_64')
license=('Apache-2.0')
makedepends=('go')
source=(https://github.com/google/${pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('de5b5daccf92e39374bed8114cbf03a0079fbee8a3ce9f584b4121eeac658c66')
b2sums=('11a39de4b478bb05e15d0fbed5267504942bb11f8772500b300fc4f96aa9a3b83a8ae0c035601049e212dc8da3099807223e04c2b67de14548991c3e452063ad')

build() {
  cd ${pkgname}-${pkgver}
  go build \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
    ./cmd/osv-scanner
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm 755 -t "${pkgdir}/usr/bin" \
    osv-scanner
}

# vim: ts=2 sw=2 et:
